package com.example.tests;

public class ContactData implements Comparable<ContactData>{
	private String fistName;
	private String lastName;
	private String firstAddress;
	private String telHome;
	private String telMobile;
	private String telWork;
	private String fistEmail;
	private String secondEmail;
	private String birthDay;
	private String birthMonth;
	private String birthYear;
	private String group;
	private String secondAddress;
	private String secondTelHome;
	private int indexBirthDay;
	private int indexBirthMonth;
	private int indexBirthYear;
	private int indexGroup;

	public ContactData() {
		
	}
	@Override
	public String toString() {
		return "ContactData [lastName=" + lastName + "]";
	}

	
	
	@Override
	public int hashCode() {
		//final int prime = 31;
		int result = 1;
		//result = prime * result
		//		+ ((fistName == null) ? 0 : fistName.hashCode());
		//result = prime * result
		//		+ ((lastName == null) ? 0 : lastName.hashCode());
		return result;
	}

	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (fistName == null) {
			if (other.fistName != null)
				return false;
		} else if (!fistName.equals(other.fistName))
			return false;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		return true;
	}
	@Override
	public int compareTo(ContactData other) {
		
		return this.lastName.toLowerCase().compareTo(other.lastName.toLowerCase()) ;
	}
	public ContactData withFistName(String fistName) {
		this.fistName = fistName;
		return this;
	}
	public ContactData withLastName(String lastName) {
		this.lastName = lastName;
		return this;
	}
	public ContactData withFirstAddress(String firstAddress) {
		this.firstAddress = firstAddress;
		return this;
	}
	public ContactData withTelHome(String telHome) {
		this.telHome = telHome;
		return this;
	}
	public ContactData withTelMobile(String telMobile) {
		this.telMobile = telMobile;
		return this;
	}
	public ContactData withTelWork(String telWork) {
		this.telWork = telWork;
		return this;
	}
	public ContactData withFistEmail(String fistEmail) {
		this.fistEmail = fistEmail;
		return this;
	}
	public ContactData withSecondEmail(String secondEmail) {
		this.secondEmail = secondEmail;
		return this;
	}
	public ContactData withIndexBirthDay(int indexBirthDay) {
		this.indexBirthDay = indexBirthDay;
		return this;
	}
	public ContactData withIndexGroup(int indexGroup) {
		this.indexGroup = indexGroup;
		return this;
	}
	public ContactData withIndexBirthMonth(int indexBirthMonth) {
		this.indexBirthMonth = indexBirthMonth;
		return this;
	}
	public ContactData withIndexBirthYear(int indexBirthYear) {
		this.indexBirthYear = indexBirthYear;
		return this;
	}
	public ContactData withSecondAddress(String secondAddres) {
		secondAddress = secondAddres;
		return this;
	}
	public ContactData withSecondTelHome(String secondTelHome) {
		this.secondTelHome = secondTelHome;
		return this;
	}
	public String getFistName() {
		return fistName;
	}
	public String getLastName() {
		return lastName;
	}
	public String getFirstAddress() {
		return firstAddress;
	}
	public String getTelHome() {
		return telHome;
	}
	public String getTelMobile() {
		return telMobile;
	}
	public String getTelWork() {
		return telWork;
	}
	public String getFistEmail() {
		return fistEmail;
	}
	public String getSecondEmail() {
		return secondEmail;
	}
	public String getBirthDay() {
		return birthDay;
	}
	public String getBirthMonth() {
		return birthMonth;
	}
	public String getBirthYear() {
		return birthYear;
	}
	public String getGroup() {
		return group;
	}
	public String getSecondAddress() {
		return secondAddress;
	}
	public String getSecondTelHome() {
		return secondTelHome;
	}
	public int getIndexBirthDay() {
		return indexBirthDay;
	}
	public int getIndexBirthMonth() {
		return indexBirthMonth;
	}
	public int getIndexBirthYear() {
		return indexBirthYear;
	}
	public int getIndexGroup() {
		return indexGroup;
	}
	
	
}